package cn.zn.modules.pz.his.controller;

import cn.zn.framework.common.utils.Result;
import cn.zn.modules.pz.his.entity.vo.PzAttachmentVO;
import cn.zn.modules.pz.his.service.PzAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("pz/his/pzattach")
public class PzAttachmentController {

    @Autowired
    private PzAttachmentService pzAttachmentService;

    @GetMapping("list/{ap}/{mainId}")
    public Result<List<PzAttachmentVO>> list(@PathVariable Integer ap, @PathVariable String mainId) {
        List<PzAttachmentVO> pzAttachmentList = pzAttachmentService.findByMainId(ap, mainId);
        return Result.ok(pzAttachmentList);
    }
}
